home *** CD-ROM | disk | FTP | other *** search
/ Radio Press Kit / Radio Press Kit.iso / pc / main.dxr / Internal_4_More Code.ls < prev    next >
Encoding:
Text File  |  2003-10-02  |  17.5 KB  |  442 lines

  1. global gMaster, gMasterImagesPath, gMasterDocPath, gNotes, gPath, gFolderName4, gFolderName1, gFolderName2, gFolderName3, gMasterFolder, gMasterNotesPath, gMasterLogosPath, gMasterPosterPath
  2.  
  3. on mGatherOtherLargeNames
  4.   repeat with w = 1 to gMaster.pSummaryList.count
  5.     vSmallName = gMaster.pSummaryList[w].pSmallName
  6.     repeat with g = 1 to gMaster.pPosterList.count
  7.       if gMaster.pPosterList[g].pSmallName = vSmallName then
  8.         gMaster.pSummaryList[w].pLargeName = gMaster.pPosterList[g].pLargeName
  9.       end if
  10.     end repeat
  11.   end repeat
  12.   repeat with w = 1 to gMaster.pSummaryList.count
  13.     vSmallName = gMaster.pSummaryList[w].pSmallName
  14.     repeat with g = 1 to gMaster.pLogoList.count
  15.       if gMaster.pLogoList[g].pSmallName = vSmallName then
  16.         gMaster.pSummaryList[w].pLargeName = gMaster.pLogoList[g].pLargeName
  17.       end if
  18.     end repeat
  19.   end repeat
  20.   repeat with w = 1 to gMaster.pSummaryList.count
  21.     if gMaster.pSummaryList[w].pType = "productionNotes" then
  22.       gMaster.pSummaryList[w].pLargeName = gNotes.pProductionFileNamePDFenglish
  23.       exit repeat
  24.     end if
  25.   end repeat
  26.   repeat with w = 1 to gMaster.pSummaryList.count
  27.     if gMaster.pSummaryList[w].pType = "productionCredits" then
  28.       gMaster.pSummaryList[w].pLargeName = gNotes.pProductionFileNamePDFenglish
  29.       exit repeat
  30.     end if
  31.   end repeat
  32. end
  33.  
  34. on mGatherDownloadInfo
  35.   vTempTotal = 0
  36.   vFileTotal = 0
  37.   repeat with x = 1 to gMaster.pSummaryList.count
  38.     if gMaster.pSummaryList[x].pSelected = "yes" then
  39.       vFileTotal = vFileTotal + 1
  40.       case gMaster.pSummaryList[x].pType of
  41.         "productionNotes":
  42.           vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.notesfolder & gMaster.pPlatformSymbol
  43.           if gMaster.pLanguageMode = "english" then
  44.             vLargeName1 = gNotes.pProductionFileNamePDFenglish
  45.             vLargeName2 = gNotes.pProductionFileNameDOCenglish
  46.           else
  47.             vLargeName1 = gNotes.pProductionFileNamePDFspanish
  48.             vLargeName2 = gNotes.pProductionFileNameDOCspanish
  49.           end if
  50.         "productionCredits":
  51.           vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.notesfolder & gMaster.pPlatformSymbol
  52.           if gMaster.pLanguageMode = "english" then
  53.             vLargeName1 = gNotes.pCreditsFileNamePDFenglish
  54.             vLargeName2 = gNotes.pCreditsFileNameDOCenglish
  55.           else
  56.             vLargeName1 = gNotes.pCreditsFileNamePDFspanish
  57.             vLargeName2 = gNotes.pCreditsFileNameDOCspanish
  58.           end if
  59.         "poster":
  60.           vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.posterfolder & gMaster.pPlatformSymbol
  61.           vLargeName1 = gMaster.pSummaryList[x].pLargeName
  62.           vLargeName2 = 0
  63.         "logo":
  64.           vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.logosfolder & gMaster.pPlatformSymbol
  65.           vLargeName1 = gMaster.pSummaryList[x].pLargeName
  66.           vLargeName2 = 0
  67.         "photo":
  68.           vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.imagesfolder & gMaster.pPlatformSymbol
  69.           vLargeName1 = gMaster.pSummaryList[x].pLargeName
  70.           vLargeName2 = 0
  71.         otherwise:
  72.           alert("you have a problem Los Angeles")
  73.       end case
  74.       vSize = baFileSize(vFromPath & vLargeName1)
  75.       vTempTotal = vTempTotal + value(vSize)
  76.       if vLargeName2 <> 0 then
  77.         vSize = baFileSize(vFromPath & vLargeName2)
  78.         vTempTotal = vTempTotal + value(vSize)
  79.       end if
  80.     end if
  81.   end repeat
  82.   if vTempTotal = 0 then
  83.     vText = "you haven't selected any files to download"
  84.     vText2 = EMPTY
  85.   else
  86.     vTempTotal2 = vTempTotal / 1024
  87.     vTempTotal3 = vTempTotal / 1024 / 1024
  88.     if vTempTotal3 > 1 then
  89.       vMegs = "megs"
  90.       vText2 = "You will need about " & vTempTotal3 & " " & vMegs & " of hard drive space for this download."
  91.     else
  92.       vMegs = "meg"
  93.       vText2 = "You will need less than one meg of hard drive space for this download."
  94.     end if
  95.     vText = "You have selected " & vFileTotal & " files to download"
  96.   end if
  97.   return vText & RETURN & vText2
  98. end
  99.  
  100. on GatherInfo vMode
  101.   gFolderName1 = gMaster.pGeneralSettings.title
  102.   gFolderName2 = gMaster.pExternalFolders.imagesfolder
  103.   gFolderName3 = gMaster.pExternalFolders.docsfolder
  104.   gFolderName4 = gMaster.pExternalFolders.notesfolder
  105.   gFolderName5 = gMaster.pExternalFolders.logosfolder
  106.   gFolderName6 = gMaster.pExternalFolders.posterfolder
  107.   case vMode of
  108.     "desktop":
  109.       gPath = baSysFolder("desktop")
  110.       gMasterFolder = gPath & gFolderName1 & gMaster.pPlatformSymbol
  111.       gMasterImagesPath = gMasterFolder & gFolderName2 & gMaster.pPlatformSymbol
  112.       gMasterDocPath = gMasterFolder & gFolderName3 & gMaster.pPlatformSymbol
  113.       gMasterNotesPath = gMasterFolder & gFolderName4 & gMaster.pPlatformSymbol
  114.       gMasterLogosPath = gMasterFolder & gFolderName5 & gMaster.pPlatformSymbol
  115.       gMasterPosterPath = gMasterFolder & gFolderName6 & gMaster.pPlatformSymbol
  116.     "harddrive":
  117.       fileObj = xtra("FileXtra4").new()
  118.       gPath = fx_FolderSelectDialog(fileObj, "aaa")
  119.       gMasterFolder = gPath & gFolderName1 & gMaster.pPlatformSymbol
  120.       gMasterImagesPath = gMasterFolder & gFolderName2 & gMaster.pPlatformSymbol
  121.       gMasterDocPath = gMasterFolder & gFolderName3 & gMaster.pPlatformSymbol
  122.       gMasterNotesPath = gMasterFolder & gFolderName4 & gMaster.pPlatformSymbol
  123.       gMasterLogosPath = gMasterFolder & gFolderName5 & gMaster.pPlatformSymbol
  124.       gMasterPosterPath = gMasterFolder & gFolderName6 & gMaster.pPlatformSymbol
  125.   end case
  126. end
  127.  
  128. on MasterSaveShowDialog
  129.   vText = mGatherDownloadInfo()
  130.   sprite(152).member.text = vText
  131.   showFlashDialog()
  132. end
  133.  
  134. on MasterSave vWhichOne, vMode
  135.   case vWhichOne of
  136.     "deskTop":
  137.       GatherInfo("deskTop")
  138.     "harddrive":
  139.       GatherInfo("harddrive")
  140.   end case
  141.   vPoster = 0
  142.   vOK = "no"
  143.   repeat with x = 1 to gMaster.pPhotoList.count
  144.     if gMaster.pPhotoList[x].pSelected = "yes" then
  145.       vOK = "yes"
  146.       exit repeat
  147.     end if
  148.   end repeat
  149.   repeat with x = 1 to gMaster.pPosterList.count
  150.     if gMaster.pPosterList[x].pSelected = "yes" then
  151.       vOK = "yes"
  152.       exit repeat
  153.     end if
  154.   end repeat
  155.   case vOK of
  156.     "no":
  157.       nothing()
  158.     "yes":
  159.       nothing()
  160.     otherwise:
  161.       alert(" you have a problem with vOK")
  162.   end case
  163.   OK = baCreateFolder(gMasterFolder & gFolderName2 & gMaster.pPlatformSymbol)
  164.   vSkip = "yes"
  165.   repeat with x = 1 to gMaster.pPhotoList.count
  166.     if gMaster.pPhotoList[x].pSelected = "yes" then
  167.       vName = gMaster.pPhotoList[x].pLargeName
  168.       if gMaster.pPhotoList[x].pOKtoDownload = "yes" then
  169.         if baFileExists(gMaster.pMasterPath & gMaster.pInternalFolders.imagesfolder & gMaster.pPlatformSymbol & vName) = 1 then
  170.           mGatherDownloadInfo(gMaster.pMasterPath & gMaster.pInternalFolders.imagesfolder & gMaster.pPlatformSymbol & vName)
  171.           vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.imagesfolder & gMaster.pPlatformSymbol
  172.           vTemp = (the environment).productVersion
  173.           if the platform contains "Mac" then
  174.             case vTemp of
  175.               "8.5.1", "8.5":
  176.                 oneFile = new(xtra("progresscopy"), 1, 100, 100)
  177.                 copyFile(oneFile, vFromPath & vName, gMasterImagesPath & vName, 1, 1, 1)
  178.                 oneFile = 0
  179.               otherwise:
  180.                 OK = baCopyFileProgress(vFromPath & vName, gMasterImagesPath & vName, "always", "Downloading files... ", "Cancel", 0)
  181.             end case
  182.           else
  183.             OK = baCopyFileProgress(vFromPath & vName, gMasterImagesPath & vName, "always", "Downloading files... ", "Cancel", 0)
  184.           end if
  185.           vSkip = "no"
  186.         end if
  187.       end if
  188.     end if
  189.   end repeat
  190.   if vSkip = "no" then
  191.     CaptionCode(gPath)
  192.   end if
  193.   SavePoster()
  194.   SaveLogos()
  195.   if vMode = "with" then
  196.     SaveNotes()
  197.   end if
  198. end
  199.  
  200. on SavePoster
  201.   vSkip = "yes"
  202.   repeat with x = 1 to gMaster.pPosterList.count
  203.     if gMaster.pPosterList[x].pSelected = "yes" then
  204.       vSkip = "no"
  205.       exit repeat
  206.     end if
  207.   end repeat
  208.   if vSkip = "yes" then
  209.     exit
  210.   else
  211.     vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.posterfolder & gMaster.pPlatformSymbol
  212.     vToPath = gMasterPosterPath
  213.     OK = baCreateFolder(gMasterPosterPath)
  214.     repeat with x = 1 to gMaster.pPosterList.count
  215.       if gMaster.pPosterList[x].pSelected = "yes" then
  216.         vlargeName = gMaster.pPosterList[x].pLargeName
  217.         if baFileExists(vFromPath & vlargeName) = 1 then
  218.           vTemp = (the environment).productVersion
  219.           if the platform contains "Mac" then
  220.             case vTemp of
  221.               "8.5.1", "8.5":
  222.                 put "posterfound 8.5.1"
  223.                 oneFile = new(xtra("progresscopy"), 1, 100, 100)
  224.                 copyFile(oneFile, vFromPath & vlargeName, vToPath & vlargeName, 1, 1, 1)
  225.                 oneFile = 0
  226.               otherwise:
  227.                 put "posterfound 9.0"
  228.                 OK = baCopyFileProgress(vFromPath & vlargeName, vToPath & vlargeName, "always", "Downloading files... ", "Cancel", 0)
  229.             end case
  230.             next repeat
  231.           end if
  232.           put "posterfound 9.0 Win"
  233.           OK = baCopyFileProgress(vFromPath & vlargeName, vToPath & vlargeName, "always", "Downloading files... ", "Cancel", 0)
  234.         end if
  235.       end if
  236.     end repeat
  237.   end if
  238. end
  239.  
  240. on SaveLogos
  241.   vSkip = "yes"
  242.   repeat with x = 1 to gMaster.pLogoList.count
  243.     if gMaster.pLogoList[x].pSelected = "yes" then
  244.       vSkip = "no"
  245.       exit repeat
  246.     end if
  247.   end repeat
  248.   if vSkip = "yes" then
  249.     exit
  250.   else
  251.     vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.logosfolder & gMaster.pPlatformSymbol
  252.     vToPath = gMasterLogosPath
  253.     OK = baCreateFolder(vToPath)
  254.     repeat with x = 1 to gMaster.pLogoList.count
  255.       if gMaster.pLogoList[x].pSelected = "yes" then
  256.         vlargeName = gMaster.pLogoList[x].pLargeName
  257.         if baFileExists(vFromPath & vlargeName) = 1 then
  258.           vTemp = (the environment).productVersion
  259.           if the platform contains "Mac" then
  260.             case vTemp of
  261.               "8.5.1", "8.5":
  262.                 put "logofound 8.5.1"
  263.                 oneFile = new(xtra("progresscopy"), 1, 100, 100)
  264.                 copyFile(oneFile, vFromPath & vlargeName, vToPath & vlargeName, 1, 1, 1)
  265.                 oneFile = 0
  266.               otherwise:
  267.                 OK = baCopyFileProgress(vFromPath & vlargeName, vToPath & vlargeName, "always", "Downloading files... ", "Cancel", 0)
  268.             end case
  269.             next repeat
  270.           end if
  271.           put "logofound 9.0"
  272.           OK = baCopyFileProgress(vFromPath & vlargeName, vToPath & vlargeName, "always", "Downloading files... ", "Cancel", 0)
  273.           put "logofound 9.0 Win"
  274.         end if
  275.       end if
  276.     end repeat
  277.   end if
  278. end
  279.  
  280. on SaveNotesOnly
  281.   if (gMasterImagesPath = EMPTY) or (gMasterDocPath = EMPTY) then
  282.     GatherInfo("deskTop")
  283.     OK = baCreateFolder(gMasterFolder & gFolderName2 & gMaster.pPlatformSymbol)
  284.     SaveNotes()
  285.   else
  286.     SaveNotes()
  287.   end if
  288. end
  289.  
  290. on SaveNotes
  291.   vSkip = "yes"
  292.   vP = gNotes.pProductionSelected
  293.   vC1 = gNotes.pCastSelected
  294.   vC2 = gNotes.pCreditsSelected
  295.   vF = gNotes.pFilmmakerSelected
  296.   if (vP = "yes") or (vC1 = "yes") or (vC2 = "yes") or (vF = "yes") then
  297.     vSkip = "no"
  298.   end if
  299.   if vSkip = "yes" then
  300.     exit
  301.   else
  302.     vFromPath = gMaster.pMasterPath & gMaster.pInternalFolders.notesfolder & gMaster.pPlatformSymbol
  303.     vToPath = gMasterNotesPath
  304.     OK = baCreateFolder(gMasterNotesPath)
  305.     if vP = "yes" then
  306.       if gMaster.pLanguageMode = "english" then
  307.         vNotesPDF = gNotes.pProductionFileNamePDFenglish
  308.         vNotesDOC = gNotes.pProductionFileNameDOCenglish
  309.       else
  310.         vNotesPDF = gNotes.pProductionFileNamePDFspanish
  311.         vNotesDOC = gNotes.pProductionFileNameDOCspanish
  312.       end if
  313.       if (baFileExists(vFromPath & vNotesPDF) = 1) and (baFileExists(vFromPath & vNotesDOC) = 1) then
  314.         vTemp = (the environment).productVersion
  315.         if the platform contains "Mac" then
  316.           case vTemp of
  317.             "8.5.1", "8.5":
  318.               oneFile = new(xtra("progresscopy"), 1, 100, 100)
  319.               copyFile(oneFile, vFromPath & vNotesPDF, vToPath & vNotesPDF, 1, 1, 1)
  320.               copyFile(oneFile, vFromPath & vNotesDOC, vToPath & vNotesDOC, 1, 1, 1)
  321.               oneFile = 0
  322.             otherwise:
  323.               OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  324.               OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  325.           end case
  326.         else
  327.           OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  328.           OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  329.         end if
  330.       end if
  331.     end if
  332.     if vC1 = "yes" then
  333.       vNotesPDF = gNotes.pCastFileNamePDF
  334.       vNotesDOC = gNotes.pCastFileNameDOC
  335.       if (baFileExists(vFromPath & vNotesPDF) = 1) and (baFileExists(vFromPath & vNotesDOC) = 1) then
  336.         vTemp = (the environment).productVersion
  337.         if the platform contains "Mac" then
  338.           case vTemp of
  339.             "8.5.1", "8.5":
  340.               oneFile = new(xtra("progresscopy"), 1, 100, 100)
  341.               copyFile(oneFile, vFromPath & vNotesPDF, vToPath & vNotesPDF, 1, 1, 1)
  342.               copyFile(oneFile, vFromPath & vNotesDOC, vToPath & vNotesDOC, 1, 1, 1)
  343.               oneFile = 0
  344.             otherwise:
  345.               OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  346.               OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  347.           end case
  348.         else
  349.           OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  350.           OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  351.         end if
  352.       end if
  353.     end if
  354.     if vC2 = "yes" then
  355.       if gMaster.pLanguageMode = "english" then
  356.         vNotesPDF = gNotes.pCreditsFileNamePDFenglish
  357.         vNotesDOC = gNotes.pCreditsFileNameDOCenglish
  358.       else
  359.         vNotesPDF = gNotes.pCreditsFileNamePDFspanish
  360.         vNotesDOC = gNotes.pCreditsFileNameDOCspanish
  361.       end if
  362.       if (baFileExists(vFromPath & vNotesPDF) = 1) and (baFileExists(vFromPath & vNotesDOC) = 1) then
  363.         vTemp = (the environment).productVersion
  364.         if the platform contains "Mac" then
  365.           case vTemp of
  366.             "8.5.1", "8.5":
  367.               put "creditnotesfound 8.5.1"
  368.               oneFile = new(xtra("progresscopy"), 1, 100, 100)
  369.               copyFile(oneFile, vFromPath & vNotesPDF, vToPath & vNotesPDF, 1, 1, 1)
  370.               copyFile(oneFile, vFromPath & vNotesDOC, vToPath & vNotesDOC, 1, 1, 1)
  371.               oneFile = 0
  372.             otherwise:
  373.               OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  374.               OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  375.           end case
  376.         else
  377.           put "creditnotesfound 9.0"
  378.           put "creditnotesfound 9.0 win"
  379.           OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  380.           OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  381.         end if
  382.       end if
  383.     end if
  384.     if vF = "yes" then
  385.       vNotesPDF = gNotes.pFilmmakerFileNamePDF
  386.       vNotesDOC = gNotes.pFilmmakerFileNameDOC
  387.       if (baFileExists(vFromPath & vNotesPDF) = 1) and (baFileExists(vFromPath & vNotesDOC) = 1) then
  388.         vTemp = (the environment).productVersion
  389.         if the platform contains "Mac" then
  390.           case vTemp of
  391.             "8.5.1", "8.5":
  392.               oneFile = new(xtra("progresscopy"), 1, 100, 100)
  393.               copyFile(oneFile, vFromPath & vNotesPDF, vToPath & vNotesPDF, 1, 1, 1)
  394.               copyFile(oneFile, vFromPath & vNotesDOC, vToPath & vNotesDOC, 1, 1, 1)
  395.               oneFile = 0
  396.             otherwise:
  397.               OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  398.               OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  399.           end case
  400.         else
  401.           OK2 = baCopyFileProgress(vFromPath & vNotesPDF, vToPath & vNotesPDF, "always", "Downloading files... ", "Cancel", 0)
  402.           OK3 = baCopyFileProgress(vFromPath & vNotesDOC, vToPath & vNotesDOC, "always", "Downloading files... ", "Cancel", 0)
  403.         end if
  404.       end if
  405.     end if
  406.   end if
  407. end
  408.  
  409. on getDestFromUser vFolder
  410.   fileObj = xtra("FileXtra4").new()
  411.   if the platform contains "Mac" then
  412.     thePath = fileObj.fx_FileSaveAsDialog("Macintosh HD:", vFolder, "Save")
  413.   else
  414.     thePath = fileObj.fx_FileSaveAsDialog(the moviePath, vFolder, "Save", 1)
  415.   end if
  416.   fileObj = 0
  417. end
  418.  
  419. on testNotes
  420.   if baFileExists(the moviePath & "notes:note1.rtf") = 1 then
  421.     put "yes it can find the file"
  422.   end if
  423. end
  424.  
  425. on testNotes2
  426.   global fileObj, gOrginalNotesPath
  427.   if the platform contains "Mac" then
  428.     gOrginalNotesPath = the moviePath & "notes:"
  429.   else
  430.     gOrginalNotesPath = the moviePath & "notes\"
  431.   end if
  432.   fileObj = xtra("FileXtra4").new()
  433.   if fx_FileExists(fileObj, gOrginalNotesPath & "jerryfix.dir") = 1 then
  434.     x = gOrginalNotesPath & "jerryfix.dir"
  435.     y = the moviePath & "Antwone Fisher:docs:jerryfix2.dir"
  436.     fx_FileCopy(fileObj, x, y)
  437.     vError = fileObj.fx_ErrorString()
  438.     fileObj = 0
  439.   end if
  440.   put vError
  441. end
  442.